﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;
using SectionSignAndFilled.StairsRoomSection.ElementPacket;

namespace SectionSignAndFilled.StairsRoomSection.Kit
{
	internal class LinesSort
	{
		public bool DivByMaterial(List<ElementObject> objs, View viewSec, Document document)
		{
			new List<LinesMaterial>();
			List<string> list = new List<string>();
			for (int i = 0; i < objs.Count; i++)
			{
				string strMaterial = objs[i].m_strMaterial;
				int num = list.IndexOf(strMaterial);
				if (num != -1)
				{
					this.m_lstAllLinesBySort[num].m_lstallObjs.Add(objs[i]);
				}
				else
				{
					LinesMaterial linesMaterial = new LinesMaterial();
					linesMaterial.m_strFillMaterial = strMaterial;
					linesMaterial.m_lstallObjs.Add(objs[i]);
					this.m_lstAllLinesBySort.Add(linesMaterial);
					list.Add(strMaterial);
				}
			}
			for (int j = 0; j < this.m_lstAllLinesBySort.Count; j++)
			{
				this.m_lstAllLinesBySort[j].Recognition(viewSec, document);
			}
			return true;
		}

		public List<LinesMaterial> m_lstAllLinesBySort = new List<LinesMaterial>();
	}
}
